package com.apa7.keepaccounts.dto;

public class ReturnData {
    private int code=0;
    private Object msg="";
    private Object data="";

    //成功不返回数据的构造器
    public ReturnData(){

    }

    //失败的构造器
    public ReturnData(String data){
        this.code=500;
        this.msg=data;
    }

    //自由搭配的构造器
    public ReturnData(int code,Object data) {
        if (code == 0){
            this.data = data;
        }else{
            this.code=code;
            this.msg=data;
        }

    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public Object getMsg() {
        return msg;
    }

    public void setMsg(Object msg) {
        this.msg = msg;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
